import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:school_assistant_m/app/routes/app_pages.dart';
import 'package:school_assistant_m/widgets/setting_item_widget.dart';

import '../controllers/settings_controller.dart';

class SettingsView extends GetView<SettingsController> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 0.2,
        leading: IconButton(
          onPressed: Get.back,
          icon: Icon(
            Icons.arrow_back_ios,
            color: Colors.black,
          ),
        ),
        backgroundColor: Color(0xFFEDEDED),
        title: Text(
          '设置',
          style: TextStyle(
            color: Colors.black,
            fontWeight: FontWeight.w700,
          ),
        ),
        centerTitle: true,
      ),
      body: Container(
        height: Get.height,
        color: Color(0xffebebeb),
        child: SingleChildScrollView(
          child: Column(
            children: [
              SettingItem(
                title: '我的信息',
                onPressed: () {},
                showDivider: true,
              ),
              SettingItem(
                title: '修改密码',
                onPressed: () {
                  Get.toNamed(Routes.EDIT_PASSWORD);
                },
              ),
              SizedBox(height: 10.0),
              SettingItem(
                title: '退出登录',
                onPressed: controller.logout,
                // onPressed: () {
                //   Get.offAllNamed(Routes.LOGIN);
                //   Get.delete<HomeController>();
                //   homeController.plugin.removeWatermark();
                // },
                centerTitle: true,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
